<tpl> assign var=index_value value=1 </tpl>
<ul>
<tpl> foreach item = parent name = parentment from = $shop_category_array key=key </tpl>
	<li <tpl> if $smarty.foreach.parentment.iteration%2 eq 0 </tpl> class="modal2" <tpl> /if </tpl> >
  	  <dl>
  		<dt><a href="<tpl> $site_url </tpl>/home/shop.php?action=list&slcShopClass=<tpl> $parent.class_id </tpl>"><tpl> $parent.class_name </tpl></a></dt>
		<dd>
	    <tpl> foreach name = parentbaby item = baby from = $parent.child </tpl>
	      <a href="<tpl> $site_url </tpl>/home/shop.php?action=list&slcShopClass=<tpl> $baby.class_id </tpl>"><tpl> $baby.class_name </tpl></a>	
	    <tpl> /foreach </tpl>
	    </dd>
      </dl>
	</li> 
		<tpl> if ($key+1)%4 eq 0 </tpl>
			</ul><tpl> assign var=index_value value=$index_value+1 </tpl>
			<ul>
		<tpl> /if </tpl>
	<tpl> /foreach </tpl>
</ul>